package com.doraemon.module.buyer.service;

import com.doraemon.module.buyer.dto.OrderDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;


/**
 * 订单相关
 * @author doraemon
 * @date 2017/9/14
 */
public interface OrderService {
    /**
     * 创建订单
     * @param orderDTO
     * @return
     */
    OrderDTO create (OrderDTO orderDTO);

    /**
     * 查找一个订单
     * @param orderId 订单ID
     * @return 订单详情
     */
    OrderDTO findOne(String orderId);

    /**
     * 通过买家查找订单
     * @param buyerId 买家ID
     * @param pageable 分页信息
     * @return
     */
    Page<OrderDTO> findList(String buyerId, Pageable pageable);

    /**
     * 取消订单
     * @param orderDTO 订单ID
     * @return
     */
    OrderDTO cancle(OrderDTO orderDTO);

    /**
     * 完成订单
     * @param orderDTO 订单ID
     * @return
     */
    OrderDTO finished(OrderDTO orderDTO);

    /**
     * 支付订单
     * @param orderDTO 订单ID
     * @return
     */
    OrderDTO paid(OrderDTO orderDTO);

}
